\(\int (e^{-x} \sin (x)+e^x \sin (x)) \, dx\) [52]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 41 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-\frac {1}{2} e^{-x} \cos (x)-\frac {1}{2} e^x \cos (x)-\frac {1}{2} e^{-x} \sin (x)+\frac {1}{2} e^x \sin (x) \]

[Out]

-1/2*cos(x)/exp(x)-1/2*exp(x)*cos(x)-1/2*sin(x)/exp(x)+1/2*exp(x)*sin(x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {4517} \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-\frac {1}{2} e^{-x} \sin (x)+\frac {1}{2} e^x \sin (x)-\frac {1}{2} e^{-x} \cos (x)-\frac {1}{2} e^x \cos (x) \]

[In]

Int[Sin[x]/E^x + E^x*Sin[x],x]

[Out]

-1/2*Cos[x]/E^x - (E^x*Cos[x])/2 - Sin[x]/(2*E^x) + (E^x*Sin[x])/2

Rule 4517

Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Sin[(d_.) + (e_.)*(x_)], x_Symbol] :> Simp[b*c*Log[F]*F^(c*(a + b*x))*(S
in[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x] - Simp[e*F^(c*(a + b*x))*(Cos[d + e*x]/(e^2 + b^2*c^2*Log[F]^2)), x]
 /; FreeQ[{F, a, b, c, d, e}, x] && NeQ[e^2 + b^2*c^2*Log[F]^2, 0]

Rubi steps \begin{align*} \text {integral}& = \int e^{-x} \sin (x) \, dx+\int e^x \sin (x) \, dx \\ & = -\frac {1}{2} e^{-x} \cos (x)-\frac {1}{2} e^x \cos (x)-\frac {1}{2} e^{-x} \sin (x)+\frac {1}{2} e^x \sin (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.80 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-\frac {1}{2} e^x \left (1+e^{-2 x}\right ) \cos (x)-\frac {1}{2} e^x \left (-1+e^{-2 x}\right ) \sin (x) \]

[In]

Integrate[Sin[x]/E^x + E^x*Sin[x],x]

[Out]

-1/2*(E^x*(1 + E^(-2*x))*Cos[x]) - (E^x*(-1 + E^(-2*x))*Sin[x])/2

Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.68

method result size
parallelrisch \(\frac {\left (-\cos \left (x \right )-\sin \left (x \right )\right ) {\mathrm e}^{-x}}{2}-\frac {{\mathrm e}^{x} \left (\cos \left (x \right )-\sin \left (x \right )\right )}{2}\) \(28\)
default \(-\frac {{\mathrm e}^{x} \cos \left (x \right )}{2}+\frac {{\mathrm e}^{x} \sin \left (x \right )}{2}-\frac {{\mathrm e}^{-x} \cos \left (x \right )}{2}-\frac {{\mathrm e}^{-x} \sin \left (x \right )}{2}\) \(30\)
parts \(-\frac {{\mathrm e}^{x} \cos \left (x \right )}{2}+\frac {{\mathrm e}^{x} \sin \left (x \right )}{2}-\frac {{\mathrm e}^{-x} \cos \left (x \right )}{2}-\frac {{\mathrm e}^{-x} \sin \left (x \right )}{2}\) \(30\)
norman \(\frac {\left (-\frac {1}{2}+{\mathrm e}^{2 x} \tan \left (\frac {x}{2}\right )-\frac {{\mathrm e}^{2 x}}{2}+\frac {\tan \left (\frac {x}{2}\right )^{2}}{2}+\frac {{\mathrm e}^{2 x} \tan \left (\frac {x}{2}\right )^{2}}{2}-\tan \left (\frac {x}{2}\right )\right ) {\mathrm e}^{-x}}{1+\tan \left (\frac {x}{2}\right )^{2}}\) \(59\)
risch \(-\frac {{\mathrm e}^{\left (-1+i\right ) x}}{4}+\frac {i {\mathrm e}^{\left (-1+i\right ) x}}{4}-\frac {{\mathrm e}^{\left (-1-i\right ) x}}{4}-\frac {i {\mathrm e}^{\left (-1-i\right ) x}}{4}-\frac {{\mathrm e}^{\left (1+i\right ) x}}{4}-\frac {i {\mathrm e}^{\left (1+i\right ) x}}{4}-\frac {{\mathrm e}^{\left (1-i\right ) x}}{4}+\frac {i {\mathrm e}^{\left (1-i\right ) x}}{4}\) \(70\)

[In]

int(sin(x)/exp(x)+exp(x)*sin(x),x,method=_RETURNVERBOSE)

[Out]

1/2*(-cos(x)-sin(x))*exp(-x)-1/2*exp(x)*(cos(x)-sin(x))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.63 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-\frac {1}{2} \, {\left (\cos \left (x\right ) e^{\left (2 \, x\right )} - {\left (e^{\left (2 \, x\right )} - 1\right )} \sin \left (x\right ) + \cos \left (x\right )\right )} e^{\left (-x\right )} \]

[In]

integrate(sin(x)/exp(x)+exp(x)*sin(x),x, algorithm="fricas")

[Out]

-1/2*(cos(x)*e^(2*x) - (e^(2*x) - 1)*sin(x) + cos(x))*e^(-x)

Sympy [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.78 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=\frac {e^{x} \sin {\left (x \right )}}{2} - \frac {e^{x} \cos {\left (x \right )}}{2} - \frac {e^{- x} \sin {\left (x \right )}}{2} - \frac {e^{- x} \cos {\left (x \right )}}{2} \]

[In]

integrate(sin(x)/exp(x)+exp(x)*sin(x),x)

[Out]

exp(x)*sin(x)/2 - exp(x)*cos(x)/2 - exp(-x)*sin(x)/2 - exp(-x)*cos(x)/2

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.56 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-\frac {1}{2} \, {\left (\cos \left (x\right ) + \sin \left (x\right )\right )} e^{\left (-x\right )} - \frac {1}{2} \, {\left (\cos \left (x\right ) - \sin \left (x\right )\right )} e^{x} \]

[In]

integrate(sin(x)/exp(x)+exp(x)*sin(x),x, algorithm="maxima")

[Out]

-1/2*(cos(x) + sin(x))*e^(-x) - 1/2*(cos(x) - sin(x))*e^x

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.56 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-\frac {1}{2} \, {\left (\cos \left (x\right ) + \sin \left (x\right )\right )} e^{\left (-x\right )} - \frac {1}{2} \, {\left (\cos \left (x\right ) - \sin \left (x\right )\right )} e^{x} \]

[In]

integrate(sin(x)/exp(x)+exp(x)*sin(x),x, algorithm="giac")

[Out]

-1/2*(cos(x) + sin(x))*e^(-x) - 1/2*(cos(x) - sin(x))*e^x

Mupad [B] (verification not implemented)

Time = 27.97 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.76 \[ \int \left (e^{-x} \sin (x)+e^x \sin (x)\right ) \, dx=-{\mathrm {e}}^{-x}\,\left (\frac {\cos \left (x\right )}{2}+\frac {\sin \left (x\right )}{2}+\frac {{\mathrm {e}}^{2\,x}\,\cos \left (x\right )}{2}-\frac {{\mathrm {e}}^{2\,x}\,\sin \left (x\right )}{2}\right ) \]

[In]

int(exp(x)*sin(x) + exp(-x)*sin(x),x)

[Out]

-exp(-x)*(cos(x)/2 + sin(x)/2 + (exp(2*x)*cos(x))/2 - (exp(2*x)*sin(x))/2)